public class CpuTool
{
	public native int getScalingCurFreq(int cpuNum);
	public native int getScalingMinFreq(int cpuNum);
	public native int getScalingMaxFreq(int cpuNum);
	public native String getScalingAvailableFrequences(int cpuNum);
	public native String getScalingAvailableGovernors(int cpuNum);
	public native String getScalingGovernor(int cpuNum);
	public native int getScalingSetSpeed(int cpuNum);

	public native int setCpuGovernor(String result, int cpuNum);
	public native int setScalingSetSpeed(int freq, int cpuNum);

	public native int getCpuUsage(int step, int totalSteps, String fileName);
	public native int getNetworkUsage(int step, int totalSteps, String fileName);
	public native int getMemoryUsage(int step, int totalSteps, String fileName);
	public native int getDiskUsage(int step, int totalSteps, String fileName);

	public native int genJPGFile(String inputFile, String outputFile);
	public native int genPDFFile(String inputFile, String outputFile);
	public native int genPNGFile(String inputFile, String outputFile);
	public native int genCSVFile(String inputFile, String outputFile);


	//	public native boolean booleanMethod(boolean bool);
	//	public native String stringMethod(String text);
	//	public native int intArrayMethod(int[] intArray);

	public static void main(String[] args)
	{
		System.setProperty("java.library.path", ".");
		System.loadLibrary("CpuTool");
		CpuTool cpuTool = new CpuTool();
		int curfreq = cpuTool.getScalingCurFreq(0);
		System.out.println("cur_freq:" + curfreq);
		int minFreq = cpuTool.getScalingMinFreq(0);
		System.out.println("minFreq:" + minFreq);
		//cpuTool.getCpuUsage(1, 10, "cpu.txt");
		cpuTool.genJPGFile("cpu.txt", "cpu.jpg");

		//	int sum = sample.intArrayMethod(
		//	new int[]{1,1,2,3,5,8,13} );
		//	System.out.println("intArrayMethod: " + sum);
	}
}
